package com.auto.util;

import java.io.File;
import java.io.IOException;

import org.apache.commons.io.FileUtils;
import org.openqa.selenium.OutputType;
import org.openqa.selenium.TakesScreenshot;
import org.openqa.selenium.WebDriver;

public class Util {

	private static String path = "screen";

	public static void captureScreen(WebDriver dr, String captureName,
			String format) {
		File screenShotFile = ((TakesScreenshot) dr)
				.getScreenshotAs(OutputType.FILE);

		LOG.star(screenShotFile.getAbsolutePath());
		try {
			FileUtils.copyFileToDirectory(screenShotFile, new File(path));
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}
